package com.tedu.dao;

import com.tedu.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用户的mapper
 */
@Mapper
public interface UserMapper {

    @Select("SELECT * FROM user WHERE name=#{name} AND password=#{password}")
    List<User> getUserByUser(User user);

    @Insert("INSERT INTO user (NAME,PASSWORD,phone) VALUES(#{name},#{password},#{phone})")
    int insertUser(User user);

    @Select("SELECT * FROM user WHERE name=#{name}")
    List<User>  getUserByName(String name);
}
